import React, { Component } from 'react'
import News from "./News";
import Message from "./Message";
import { Route,Switch,Redirect} from 'react-router-dom'
import MyNavLink from "../../components/Router/MyNavLink"; //一般组件
export default class Home extends Component {
    render() {
        return (
            <div>
                 <h3>我是Home的内容</h3>
                 <div>
                    <ul className="nav nav-tabs">
                    
                        <MyNavLink to="/home/news">News</MyNavLink>
                        {/* <a className="list-group-item" href="./home-news.html">News</a> */}
                   
                   
                         <MyNavLink to="/home/message">Message</MyNavLink>
                        {/* <a className="list-group-item active" href="./home-message.html">Message</a> */}
                    
                    </ul>
                    {/* 注册路由 */}
                    <Switch>
                        <Route path='/home/news' component={News} />
                        <Route path='/home/message' component={Message} />
                        <Redirect to="/home/news"></Redirect>
                    </Switch>
                 </div>
            </div>
        )
    }
}
